Content starts here Support for Derived Simple Types
This page last changed on Apr 02, 2008.

edocs Home > BEA AquaLogic Data Services Platform 3.0/3.2 Documentation > ALDSP 3.2 New Features Documentation

Support for Derived Simple Types

This topic describes the support for derived simple types in AquaLogic Data Services Platform (ALDSP) 3.2.

Introduction 

ALDSP 3.2 enables you to employ user-derived simple types as parameters or return types in data service operations accessed through the ALDSP Mediator API.

The Mediator API is the Java API for retrieving artifacts from a data service and returning them to their source. In your Java client, you can call Mediator API methods to connect to a data service and invoke data service operations.

This enables you to create a simple type in a schema which restricts a built-in schema type, and use that type as either a parameter type or a return type for a data service operation, successfully invoking the operation through the ALDSP Mediator API.

For example, you might declare a simple type called ZipCode that derives from xsd:string, as shown in the following:

<xs:simpleType name="ZipCode">
   <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]{5}(-[0-9]{4})?"/>
   </xs:restriction>
</xs:simpleType>

ALDSP 3.2 enables you to use this type as a parameter type or return type for a data service operation.

Mapping Derived Schema Types to Java Types

The mapping of derived schema types to Java types is defined by the SDO specification and, with one exception, is identical to the mapping of the corresponding built-in schema types. For example, if a user type is derived from xs:string, the Java class is java.lang.String. Similarly, if a user type is derived from xs:byte, the Java class is java.lang.Byte.

See Mapping Data Service Types to Java Typesfor the complete mapping between XQuery and Java types.

The single exception involves using XSD types that are derived from xs:integer and include facets (such as minInclusive, maxInclusive, minExclusive, maxExclusive, or enumeration) constraining the range to be within the range of the Java data type int. ALDSP 3.2 maps these XSD types to the Java type java.lang.Integer instead of the default type java.math.BigInteger.

Note that this is also true for user XSD types that derive from the following schema built-in types (which are themselves derived from xs:integer):

  • xs:positiveInteger
  • xs:negativeInteger
  • xs:nonPositiveInteger
  • xs:nonNegativeInteger
  • xs:long
  • xs:unsignedLong
    You cannot use types derived from xs:QName. Attempting to use these types in data service operations may cause an exception.

See Also

Reference
Document generated by Confluence on Apr 28, 2008 16:19